package com.atXiao.template;

import com.atXiao.design.PaymentStrategy;

// 定义模板类
public abstract class PaymentTemplate {
    abstract PaymentStrategy createPaymentStrategy();

    public void pay(int amount) {
        PaymentStrategy paymentStrategy = createPaymentStrategy();
        paymentStrategy.pay(amount);
    }
}